<div class="pm_table">
    <table class="contactItem-container fixedLayout">
        <thead>
            <tr>
                <th scope="col" class="invalid-key-column"></th>
                <th scope="col" translate-context="Table Header" translate>Fingerprint</th>
                <th scope="col" class="primary" ng-if="enableDelete">
                    <i class="fa fa-info-circle"
                       pt-tooltip-translate="The primary key is used to encrypt outgoing messages."
                       pt-tooltip-translate-context="Tooltip">
                    </i>
                    <span translate-context="Table Header" translate>Primary</span>
                </th>
                <th scope="col" class="primary" ng-if="!enableDelete">
                    <i
                        class="fa fa-info-circle"
                        pt-tooltip-translate="It is allowed to encrypt with this key"
                        pt-tooltip-translate-context="Tooltip">
                    </i>
                    <span translate-context="Table Header" translate>Encryption</span>
                </th>
                <th scope="col" class="created"
                    translate-context="Table Header"
                    translate>Created</th>
                <th scope="col" class="expires"
                    ng-if="enableDelete"
                    translate-context="Table Header"
                    translate>Expires</th>
                <th scope="col" class="bits"
                    translate-context="Table Header"
                    translate>Type</th>
                <th scope="col" class="actions"
                    translate-context="Table Header"
                    translate>Actions</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="item in items" ng-if="!item.hide">
                <td class="invalid-key-column">
                    <i class="fa fa-warning"
                       ng-if="item.invalidMessage"
                       pt-tooltip="{{ item.invalidMessage }}"></i>
                </td>
                <td>
                    <span class="publickey-info">
                        <code pt-tooltip="{{ item.fingerprint }}">
                            {{ item.fingerprint }}
                        </code>
                    </span>
                </td>
                <td class="primary">
                    <button
                        class="pm_button link small"
                        type="button"
                        data-action="makePrimary"
                        data-index="{{ $index }}"
                        ng-if="!item.verificationOnly && $index > 0 && !item.isExpired && enableDelete"
                        translate-context="Button"
                        translate-comment="Make sure the string is short"
                        translate>Set Primary</button>
                    <i class="fa fa-check"
                       ng-if="!item.verificationOnly && !item.isExpired && (!enableDelete || $index === 0)"
                    ></i>
                </td>
                <td class="created">
                    {{ item.created }}
                </td>
                <td class="expires" ng-if="enableDelete">
                    {{ item.expires }}
                </td>
                <td class="bits">
                    {{ item.algType }}
                </td>
                <td class="actions">
                    <button
                        type="button"
                        class="fa fa-download pm_button link"
                        data-index="{{ $index }}"
                        data-action="{{ enableDelete ? 'download' : 'downloadUntrusted' }}"
                        pt-tooltip-translate="Download"
                        pt-tooltip-translate-context="Tooltip"
                    ></button>
                    <button ng-if="enableDelete"
                        type="button"
                        class="fa fa-trash pm_button link"
                        data-action="remove"
                        data-index="{{ $index }}"
                        pt-tooltip-translate="Remove"
                        pt-tooltip-translate-context="Tooltip"
                    ></button>
                    <button ng-if="enableTrust"
                        type="button"
                        class="fa fa-check pm_button link"
                        data-action="moveToTrusted"
                        data-index="{{ $index }}"
                        pt-tooltip-translate="Trust"
                        pt-tooltip-translate-context="Tooltip"
                    ></button>
                </td>
            </tr>
            <tr class="empty-table">
                <td colspan="6">
                    <i class="fa fa-lg fa-thumbs-o-up"></i>
                    <span
                        translate-context="Empty table message"
                        translate>All available keys are trusted</span>
                </td>
            </tr>
        </tbody>
    </table>
</div>
